Release 10.1A: OpenEdge Getting Started:
Object-oriented Programming


Class-based and procedure-based object compatibility

Progress allows class-based objects and procedures to co-exist and work together to form a complete application. This section describes the features and limitations of mixing class-based objects and persistent procedures.

Each class defines a user-defined data type. You must use the syntax described in this manual to instantiate a class-based object and run its methods. You can use this syntax to instantiate a class and to run its methods in a procedure as well as in another class. In other words, a procedure can use the NEW statement to create an instance of class, work with it, and delete it when it is no longer needed. The procedure can pass a reference to the object as a parameter in any procedure or user-defined function call. In addition, a user-defined function can define its return value to be an object reference. Classes and class-based objects are just another development tool that you have at your disposal.

From the opposite perspective, a method in a class can run a procedure using the same procedure-based syntax for running internal procedures within external procedures. A class can run a procedure persistently and save a handle to it just as another procedure can do. The class can run internal procedures and user-defined functions using that handle. It can delete the procedure when it is no longer needed. A method in the class can pass a procedure handle as a parameter or use it as a return value.

In summary, the restrictions that apply to classes and procedures apply to a limited set of definitional statements that are used in one or the other, not to the way in which they can interact with each other.


Copyright © 2005 Progress Software Corporation
www.progress.com
Voice: (781) 280-4000
Fax: (781) 280-4095